package com.luhuiguo.cms.server.service;

import java.util.List;

import com.luhuiguo.cms.server.entity.Attachment;
import com.luhuiguo.cms.server.service.restriction.AttachmentFilter;

public interface AttachmentService {

    Attachment getAttachment(Long id);
    
    void saveAttachment(Attachment attachment);

    Attachment updateAttachment(Attachment attachment);

    void deleteAttachment(Long id);

    void deleteAttachmentByArticleId(Long articleId);

    List<Attachment> findAttachmentByArticleId(Long articleId, int... rowStartIdxAndCount);
    
    int getAttachmentCountByArticleId(Long articleId);

    List<Attachment> findAttachmentByArticleIdAndType(Long articleId, int type);

    List<Attachment> findAttachments(AttachmentFilter filter, int... rowStartIdxAndCount);

    int getAttachmentCount(AttachmentFilter filter);
    
}
